from tkinter import *
 
root = Tk()
root.title('1 этап МАРАФОН 2127')
root.geometry('500x500')
 
canvas = Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)
x=int(input("Введите координату Х начальной точки: "))
y=int(input("Введите координату Y начальной точки: "))
K=int(input("Введите коффициент увеличения: "))
if K==0 and 0<=x<=500 and 0<=y<=500:
   pass
elif K>0 and 0*K+x>=0 and 0*K+y>=0 and 20*K+x<=500 and 20*K+y<=500:
   pass
elif K<0 and 20*K+x>=0 and 20*K+y>=0 and 0*K+x<=500 and 0*K+y<=500:
   pass
else:
   print("Фигура превысила размеры поля")
   exit()
A = [0,0, 10,0, 10,10, 20,10, 20,0, 30,0, 30,20, 0,20, 0,0]
canvas.create_polygon(K*A[0]+x, K*A[1]+y,
                      K*A[2]+x, K*A[3]+y,
                      K*A[4]+x, K*A[5]+y,
                      K*A[6]+x, K*A[7]+y,
                      K*A[8]+x, K*A[9]+y,
                      K*A[10]+x, K*A[11]+y,
                      K*A[12]+x, K*A[13]+y,
                      K*A[14]+x, K*A[15]+y,
                      K*A[16]+x, K*A[17]+y,fill='DarkBlue',activefill="green",outline="red",dash=2)
root.mainloop()
exit()

                                              
